package org.languageguide.readings.junit;

import junit.framework.TestCase;

import org.languageguide.readings.StandardWordWrapper;
import org.languageguide.readings.WordWrapper;

public class WordWrapperTest extends TestCase {

	public WordWrapperTest(String name) { 
	      super(name);
	   }

	   public void testSentenceWrapperTest() {
		   String paragraph = "<p>Although the Yapese.</p>";
		   WordWrapper wrapper = new StandardWordWrapper();
		   String wrappedText = wrapper.wrap(paragraph);
		   assertEquals(wrappedText, "<p><span class=\"w\" id=\"w0\">Although</span> <span class=\"w\" id=\"w1\">the</span> <span class=\"w\" id=\"w2\">Yapese</span>.</p>");
		   
		   paragraph = "<p>P.S. We love you.</p>";
		   wrapper = new StandardWordWrapper();
		   wrappedText = wrapper.wrap(paragraph);
		   assertEquals(wrappedText, "<p><span class=\"w\" id=\"w0\">P.S.</span> <span class=\"w\" id=\"w1\">We</span> <span class=\"w\" id=\"w2\">love</span> <span class=\"w\" id=\"w3\">you</span>.</p>");
		   
		   paragraph = "<p>There are 6.859 billion humans</p>";
		   wrapper = new StandardWordWrapper();
		   wrappedText = wrapper.wrap(paragraph);
		   assertEquals(wrappedText, "<p><span class=\"w\" id=\"w0\">There</span> <span class=\"w\" id=\"w1\">are</span> <span class=\"w\" id=\"w2\">6.859</span> <span class=\"w\" id=\"w3\">billion</span> <span class=\"w\" id=\"w4\">humans</span></p>");
	   }
	
	
}
